<?php
/**
 * Created by PhpStorm.
 * User: songdewei
 * Date: 2017/10/17
 * Time: 上午11:49
 */

namespace Data\Company;


use Core\Model;

class ProductModel extends Model
{
    protected $table = 'product';

    /**
     * @param $product_id
     */
    public function deleteAllData($product_id){
        $condition = array('product_id'=>$product_id);
        if ($this->where($condition)->delete()){
            (new ProductContentModel())->where($condition)->delete();
            (new ProductImageModel())->where($condition)->delete();
        }
    }
}